ratyStar = {
	ajaxVote : function(objId, score, objType) {
		var ratyStarObj='#ratyStar_'+objId;
		var _url;
		if (objType == 'SPOT')
			_url = "/skyline/spot/vote.html";
		else if (objType == 'SC')
			_url = "/skyline/spot/chara/vote.html";
		else
			return;
		jQuery.ajax({
			url : _url,
			type : "POST",
			data : "objId=" + objId + "&star=" + score,
			dataType : "json",
			contentType : "application/x-www-form-urlencoded; charset=utf-8",
			success : function(obj) {
				if (obj.loginStatus) {
					// alert(obj.SpotStar);
					$(ratyStarObj).raty.start(obj.Star, ratyStarObj);
					$(ratyStarObj).raty.readOnly(true);
					// alert(msg.VoteNum);readOnly
					$('#voteNum').text(obj.VoteNum);
					if (obj.Raty_Tag) {
						alert("你已经评价过了");
					}
				} else {
					ajaxLogin();
				}
			}
		});
	},
	initRatyStar : function(objId, startStar, objType, isReadOnly, isBig) {
		var ratyStarObj='#ratyStar_'+objId;
		var _readOnly=false;
		if(isReadOnly=="true")
			_readOnly=true;
		if (isBig == "true") {
			$(ratyStarObj).raty({
				readOnly : _readOnly,
				start : startStar,
				size : 24,
				starOff : 'star-off-big.png',
				starOn : 'star-on-big.png',
				click : function(score) {
					ratyStar.ajaxVote(objId, score, objType);

				}
			});
		} else {
			$(ratyStarObj).raty({
				readOnly : _readOnly,
				start : startStar,
				starOff : 'star-off.png',
				starOn : 'star-on.png',
				click : function(score) {
					ratyStar.ajaxVote(objId, score, objType);

				}
			});
		}
	}
}
